<template>
  <div class="departHeader">
    <div class="back" @click="goHome">
      <el-button type="primary" round>
        <SvgIcon name="back" /><span>{{ backText }}</span></el-button
      >
    </div>
    <div class="departitle">科室介绍</div>
  </div>
</template>
<script lang="ts" setup>
import { useRouter } from "vue-router";
const router = useRouter();
const props = defineProps({
  backText: { type: String, default: "返回首页" },
});
const goHome = () => {
  if (props.backText === "返回首页") {
    router.push("/home");
  } else if (props.backText === "返回科室列表") {
    router.go(-1);
  }
};
</script>
<style lang="scss" scoped>
@import "@/styles/mixins.scss";
.departHeader {
  display: flex;
  align-items: center;
  padding: 24px 30px;

  height: 128px;
  .back {
    @include buttons;
    width: 285px;
  }
  .departitle {
    font-size: 40px;
    color: #000000;
    margin-left: 20%;
  }
}
</style>
